<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>TravelDream</title>
	<style>
		.noBorders tr, .noBorders td {
   	 		background: none !important;
    		border: none !important;
		}
	</style>
	<link rel="stylesheet" type="text/css" href="../style/paginautente.css" />
</h:head>
<h:body>
	<div id="main">
		<div id="upper">
			<div id="logo"><a href="/TravelDreamWeb/home.jsf"><img id="logo-img" src="../img/logo.png"/></a></div>
			<div id="login-up">Benvenuto, #{utenteBean.name} <br />
				<h:form><p:commandButton action="#{logoutBean.logout}" value="Logout" />
				<h:link outcome="PaginaPersonale" value="Pagina Personale" /></h:form>
			</div>
		</div>
		<div id="center">
			<p:panelGrid columns="2" styleClass="noBorders" >
				<h:form id="tabellaPacchetti">		
					<p:outputLabel value="Elenco pacchetti:" />
					<p:dataTable style="width:650px" id="pacchettoPanel" value="#{pacchettoViaggioBean.listaPacchetti}" var="pacchetto" emptyMessage="Nessun pacchetto viaggio inserito."
						paginator="true" rows="10"  
        				paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        				rowsPerPageTemplate="5,10,15"> 
						<p:column headerText="Nome" >
							<h:outputText value="#{pacchetto.nome}" />
						</p:column>
						<p:column headerText="Destinazione">
							<h:outputText value="#{pacchetto.destinazione}" />
						</p:column>
						<p:column headerText="Data Validità">
							<h:outputText value="Dal " />
							<h:outputText value="#{pacchetto.dataInizio}" >
								<f:convertDateTime pattern="dd/MM/yy"/>
							</h:outputText>
							<h:outputText value=" al " />
							<h:outputText value="#{pacchetto.dataFine}" >
							<f:convertDateTime pattern="dd/MM/yy"/>
							</h:outputText>
						</p:column>
						<p:column headerText="Prezzo(€/giorno)">
							<h:outputText value="#{pacchetto.prezzo}" />
						</p:column>
						<p:column style="width:90px">
							<p:commandButton value="Visualizza info" action="#{pacchettoViaggioBean.goToInfoPacc(pacchetto.idPacchettoViaggio)}"/>
						</p:column>	
					</p:dataTable> 
				</h:form>
				<h:form id="formRicerca">
					<p:outputLabel value="Ricerca pacchetto per:" />
					<p:inputText placeholder="Nome" value="#{ricercaBean.nome}" />
					<p:inputText placeholder="Destinazione" value="#{ricercaBean.destinazione}" />
					<p:calendar id="data" value="#{ricercaBean.data}" placeholder="Data" effect="drop" mindate="#{dataBean.getDataMin()}"  
						navigator="true" />
					<p:outputLabel value="N. Persone" />
					<p:inputText placeholder="Numero persone" value="#{ricercaBean.numeroPersone}" />
					<p:outputLabel value="Prezzo(€/giorno)" />
					<p:inputText placeholder="Prezzo"  value="#{ricercaBean.prezzo}"/><br /><br />
					<p:commandButton value="Ricerca"  action="#{ricercaBean.ricercaPacchetti()}"/>
				</h:form>	
			</p:panelGrid>
		</div>
		<div id="footer">
		</div>
	</div>
</h:body>
</html>